package com.eastfair.imaster.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperCacheService;
import com.eastfair.core.base.R;
import com.eastfair.imaster.dto.ExhibitorCompanyDTO;
import com.eastfair.imaster.dto.ExhibitorDTO;
import com.eastfair.imaster.dto.ExhibitorExcelDTO;
import com.eastfair.imaster.dto.ExhibitorExcelResultDTO;
import com.eastfair.imaster.entity.Exhibitor;
import com.eastfair.imaster.vo.ExhibitorVo;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 展商
 * </p>
 *
 * @author ligang
 * @date 2021-09-07
 */
public interface ExhibitorService extends SuperCacheService<Exhibitor> {

    /**
     * 添加公司到展商
     * @param exhibitorDTO 展商
     * @return
     */
    R addCompanyOfExhibitor(ExhibitorDTO exhibitorDTO);

    /**
     * 展商剔除公司
     * @param id 展商主键id
     * @return
     */
    R removeCompanyOfExhibitor(Long id);

    /**
     * 查询展商下的公司
     * @param exhibitionId 展会id
     * @return
     */
    Exhibitor findCompany(Long companyId,Long exhibitionId);

    /**
     * 内部查询
     * @param exhibitor
     * @param ids
     * @return
     */
    List<Exhibitor> list(Exhibitor exhibitor, List<Long> ids);


    /**
     * 查询展商下的公司以及展商员工
     * @param id 展商主键id
     * @return
     */
    ExhibitorVo findCompanyOfAll(Long id);

    /**
     * 分页查询
     * @param params
     * @return
     */
    R<Page<ExhibitorVo>> queryPage(PageParams<ExhibitorDTO> params);

    /**
     * 自定义分页查询
     * @param params
     * @return
     */
    R<Page<ExhibitorVo>> queryPageDetails(PageParams<ExhibitorDTO> params);
    /**
     * 校验展商信息
     * @param exhibitionId
     * @param projectId
     * @param exhibitorExcelDTOList
     * @return
     */
    String verifyExhibitor(Long exhibitionId, Long projectId, List<ExhibitorExcelDTO> exhibitorExcelDTOList);
    /**
     * 组装数据
     * @param exhibitionId  展会id
     * @param projectId     项目id
     * @param exhibitorExcelDTOList
     * @return
     */
    List<ExhibitorExcelResultDTO> convertExhibitor(Long exhibitionId,Long projectId, List<ExhibitorExcelDTO> exhibitorExcelDTOList);
    /**
     *Description 批量保存
     *@Date 12:56 2021/9/7
     *@param exhibitorExcelResultDTOList
     *@return void
     *@Author yuwx
     **/
    void batchSave(Long exhibitionId, Long projectId,List<ExhibitorExcelResultDTO> exhibitorExcelResultDTOList);

    /**
     * 添加展商
     * @param exhibitorCompanyDTO
     * @return
     */
    R<ExhibitorVo> addExhibitor(ExhibitorCompanyDTO exhibitorCompanyDTO,Long projectId);


    /**
     * 修改展商
     * @param exhibitorCompanyDTO
     * @return
     */
    R<ExhibitorVo> updExhibitor(ExhibitorCompanyDTO exhibitorCompanyDTO,Long projectId);

    /**
     * 展商详情
     * @param id
     * @return
     */
    ExhibitorVo exhibitorDetail(Long id);

    /**
     * 展商详情(修改场景)
     * @param id
     * @return
     */
    ExhibitorVo exhibitorDetailOfEdit(Long id);

    /**
     * 批量查询展商信息
     *
     * @param  ids 展商id集合
     * @return
     */
    List<ExhibitorVo> queryByIds(List<Long> ids);

}
